import moment from 'moment'

/**
 * Upper case first char
 * @param {String} string
 */
export default function asDuration(timestrap) {
  var time = timestrap * 1000
  var x = moment(time)
  var y = moment()
  return moment
    .duration(x.diff(y))
    .locale('zh-cn')
    .humanize()
}
